import java.util.*;

public class A {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = 0;
        t = sc.nextInt();
        while(t-- > 0){
            int n = sc.nextInt();
            int[] arr = new int[100];
            for(int i = 0; i < n; i++){
                int tmp = sc.nextInt();
                arr[tmp]++;
            }
            int flag = 0;
            for(int i = 0; i < arr.length - 1; i++){
                if(arr[i + 1] > arr[i]){
                    System.out.println("NO");
                    flag = 1;
                    break;
                }
            }
            if(flag == 0){
                System.out.println("YES");
            }
        }
    }
}
